package com.jvm123.mysql.repo;

import com.jvm123.mysql.entity.Person;
import org.springframework.data.repository.Repository;
import org.springframework.transaction.annotation.Transactional;

/**
 * @author yawn
 * 2019/9/15 15:18
 */
public interface PersonQueryRepo extends Repository<Person, Long> {

    // declare query method
    // 声明式查询方法

    // count 计数
    long countByName(String name);

    // get/find/stream/query/read 查询
    Person readFirstByAge(int age);

    // delete/remove 删除
    @Transactional
    int deleteById(long id);

}
